/********************************************************************************
do-file to replicate tables in:
	Chacon, Mario and Jeff Jensen. 2019. "Democratization, De Facto Power, and Taxation: 
	Evidence from Military Occupation during Reconstruction" World Politics 

data file needed: Dataset_1 (Main Panel) 
*/

clear all 
set more off

**Set Working Directory 
*cd "C:\****\ Replication Files (Chacon & Jensen, WP 2019)\Datasets\"

*** Online Appendix Table OA2-Common Support Samples ***
use Dataset_1, clear 

** State Taxes 1860-70
global ldc lnTotPop1860 i_lnTotPop1860_DORecon ///
lnFarValRPc1860 i_lnFarValRPc1860_DORecon ///
lnAgriGdpRPc1870 i_lnAgriGdpRPc1870_DORecon ///
lnManGdpRPc1870 i_lnManGdpRPc1870_DORecon

reg del_ln_state_tax_real_pc i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1870 & cs_bs==1, r
outreg2 using Table_OA2.xls, ctitle("Table A1, St. Rev. 1860-70, CS Black Sh.") keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast replace 

reg del_ln_state_tax_real_pc i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1870 & cs_ps==1, r
outreg2 using Table_OA2.xls, ctitle("Table A1, St. Rev. 1860-70, CS Black Sh.") keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

*Inverse p-score weights + Common Support 
*gen inv_ps=1/ps
gen w=.
replace w=1 if d_occup_recon==1
replace w=(ps/(1-ps))

reg del_ln_state_tax_real_pc i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1870 & cs_ps==1 [aweight=w], r
outreg2 using Table_OA2.xls, ctitle("Table OA1, St. Rev. 1860-70, CS Black Sh.") keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

**State 1870-90
reg del2_ln_state_tax_real_pc i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1890 & cs_bs==1, r
outreg2 using Table_OA2.xls, ctitle("Table OA1, St. Rev. 1860-70, CS Black Sh.") keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

reg del2_ln_state_tax_real_pc i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1890 & cs_ps==1, r
outreg2 using Table_OA2.xls, ctitle("Table OA1, St. Rev. 1860-70, CS Black Sh.") keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

reg del2_ln_state_tax_real_pc i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1890 & cs_ps==1 [aweight=w], r
outreg2 using Table_OA2.xls, ctitle("Table OA1, St. Rev. 1860-70, CS Black Sh.") keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

** County 1870-90 
reg del2_ln_county_tax_real_pc i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1890 & cs_bs==1, r
outreg2 using Table_OA2.xls, ctitle("Table OA1, St. Rev. 1860-70, CS Black Sh.") keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

reg del2_ln_county_tax_real_pc i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1890 & cs_ps==1, r
outreg2 using Table_OA2.xls, ctitle("Table OA1, St. Rev. 1860-70, CS Black Sh.") keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

reg del2_ln_county_tax_real_pc i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1890 & cs_ps==1 [aweight=w], r
outreg2 using Table_OA2.xls, ctitle("Table OA1, St. Rev. 1860-70, CS Black Sh.") keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 
